package com.prs.crm.domain.purchase;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

import com.prs.crm.domain.BaseEntity;
import com.prs.crm.domain.hr.Person;

/**
 * @author 兰小刚
 * @version 创建时间：2010-7-14 上午10:21:28 类说明
 */
@Entity
@Table(name = "purchase_paymentorder")
public class PaymentOrder extends BaseEntity {
	private static final long serialVersionUID = -4867503240956693033L;
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;

	@OneToOne
	private PaymentGather paymentGather;
	@ManyToOne
	private PurchaseOrder purchaseOrder;
	/**
	 * 付款主题
	 */
	private String payName;
	/**
	 * 付款编号
	 */
	private String payCode;

	/**
	 * 金额
	 */

	private Double payMony;
	/**
	 * 已付款金额
	 */
	@Column(columnDefinition = "double(11,3) default '00000000000.000'")
	private Double arealymony;
	/**
	 * 剩余未付款金额
	 */

	private Double surlusMony;
	/**
	 * 销售人员
	 */
	@ManyToOne
	private Person person;
	/**
	 * 付款状态
	 * 
	 * @return
	 */
	@Column(columnDefinition = "Integer(11) default '0'")
	private int patState;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getPayName() {
		return payName;
	}

	public void setPayName(String payName) {
		this.payName = payName;
	}

	public String getPayCode() {
		return payCode;
	}

	public void setPayCode(String payCode) {
		this.payCode = payCode;
	}

	public Double getPayMony() {
		return payMony;
	}

	public void setPayMony(Double payMony) {
		this.payMony = payMony;
	}

	public Double getArealymony() {
		return arealymony;
	}

	public void setArealymony(Double arealymony) {
		this.arealymony = arealymony;
	}

	public Double getSurlusMony() {
		return surlusMony;
	}

	public void setSurlusMony(Double surlusMony) {
		this.surlusMony = surlusMony;
	}

	public Person getPerson() {
		return person;
	}

	public void setPerson(Person person) {
		this.person = person;
	}

	public Integer getPatState() {
		return patState;
	}

	public void setPatState(Integer patState) {
		this.patState = patState;
	}

	public PaymentGather getPaymentGather() {
		return paymentGather;
	}

	public void setPaymentGather(PaymentGather paymentGather) {
		this.paymentGather = paymentGather;
	}

	public void setPatState(int patState) {
		this.patState = patState;
	}

	public PurchaseOrder getPurchaseOrder() {
		return purchaseOrder;
	}

	public void setPurchaseOrder(PurchaseOrder purchaseOrder) {
		this.purchaseOrder = purchaseOrder;
	}

}
